home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume18 / notation / part02 < prev    next >
Encoding:
Internet Message Format  |  1991-04-13  |  42.2 KB

  1. From: hthomas@irisa.fr (Henry Thomas)
  2. Newsgroups: comp.sources.misc
  3. Subject: v18i013:  notation - Chess text converter, Part02/03
  4. Message-ID: <1991Apr12.032939.3610@sparky.IMD.Sterling.COM>
  5. Date: 12 Apr 91 03:29:39 GMT
  6. Approved: kent@sparky.imd.sterling.com
  7. X-Checksum-Snefru: b04da113 91616733 b52282d1 24cb263d
  8.  
  9. Submitted-by: Henry Thomas <hthomas@irisa.fr>
  10. Posting-number: Volume 18, Issue 13
  11. Archive-name: notation/part02
  12.  
  13. #! /bin/sh
  14. # This is a shell archive.  Remove anything before this line, then unpack
  15. # it by saving it into a file and typing "sh file".  To overwrite existing
  16. # files, type "sh file -c".  You can also feed this as standard input via
  17. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  18. # will see the following message at the end:
  19. #        "End of archive 2 (of 3)."
  20. # Contents:  COPYING drivers.c notation.doc
  21. # Wrapped by hthomas@illico on Thu Apr 11 14:44:54 1991
  22. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  23. if test -f 'COPYING' -a "${1}" != "-c" ; then 
  24.   echo shar: Will not clobber existing file \"'COPYING'\"
  25. else
  26. echo shar: Extracting \"'COPYING'\" \(12488 characters\)
  27. sed "s/^X//" >'COPYING' <<'END_OF_FILE'
  28. X
  29. X            GNU GENERAL PUBLIC LICENSE
  30. X             Version 1, February 1989
  31. X
  32. X Copyright (C) 1989 Free Software Foundation, Inc.
  33. X                    675 Mass Ave, Cambridge, MA 02139, USA
  34. X Everyone is permitted to copy and distribute verbatim copies
  35. X of this license document, but changing it is not allowed.
  36. X
  37. X                Preamble
  38. X
  39. X  The license agreements of most software companies try to keep users
  40. Xat the mercy of those companies.  By contrast, our General Public
  41. XLicense is intended to guarantee your freedom to share and change free
  42. Xsoftware--to make sure the software is free for all its users.  The
  43. XGeneral Public License applies to the Free Software Foundation's
  44. Xsoftware and to any other program whose authors commit to using it.
  45. XYou can use it for your programs, too.
  46. X
  47. X  When we speak of free software, we are referring to freedom, not
  48. Xprice.  Specifically, the General Public License is designed to make
  49. Xsure that you have the freedom to give away or sell copies of free
  50. Xsoftware, that you receive source code or can get it if you want it,
  51. Xthat you can change the software or use pieces of it in new free
  52. Xprograms; and that you know you can do these things.
  53. X
  54. X  To protect your rights, we need to make restrictions that forbid
  55. Xanyone to deny you these rights or to ask you to surrender the rights.
  56. XThese restrictions translate to certain responsibilities for you if you
  57. Xdistribute copies of the software, or if you modify it.
  58. X
  59. X  For example, if you distribute copies of a such a program, whether
  60. Xgratis or for a fee, you must give the recipients all the rights that
  61. Xyou have.  You must make sure that they, too, receive or can get the
  62. Xsource code.  And you must tell them their rights.
  63. X
  64. X  We protect your rights with two steps: (1) copyright the software, and
  65. X(2) offer you this license which gives you legal permission to copy,
  66. Xdistribute and/or modify the software.
  67. X
  68. X  Also, for each author's protection and ours, we want to make certain
  69. Xthat everyone understands that there is no warranty for this free
  70. Xsoftware.  If the software is modified by someone else and passed on, we
  71. Xwant its recipients to know that what they have is not the original, so
  72. Xthat any problems introduced by others will not reflect on the original
  73. Xauthors' reputations.
  74. X
  75. X  The precise terms and conditions for copying, distribution and
  76. Xmodification follow.
  77. X
  78. X            GNU GENERAL PUBLIC LICENSE
  79. X   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  80. X
  81. X  0. This License Agreement applies to any program or other work which
  82. Xcontains a notice placed by the copyright holder saying it may be
  83. Xdistributed under the terms of this General Public License.  The
  84. X"Program", below, refers to any such program or work, and a "work based
  85. Xon the Program" means either the Program or any work containing the
  86. XProgram or a portion of it, either verbatim or with modifications.  Each
  87. Xlicensee is addressed as "you".
  88. X
  89. X  1. You may copy and distribute verbatim copies of the Program's source
  90. Xcode as you receive it, in any medium, provided that you conspicuously and
  91. Xappropriately publish on each copy an appropriate copyright notice and
  92. Xdisclaimer of warranty; keep intact all the notices that refer to this
  93. XGeneral Public License and to the absence of any warranty; and give any
  94. Xother recipients of the Program a copy of this General Public License
  95. Xalong with the Program.  You may charge a fee for the physical act of
  96. Xtransferring a copy.
  97. X
  98. X  2. You may modify your copy or copies of the Program or any portion of
  99. Xit, and copy and distribute such modifications under the terms of Paragraph
  100. X1 above, provided that you also do the following:
  101. X
  102. X    a) cause the modified files to carry prominent notices stating that
  103. X    you changed the files and the date of any change; and
  104. X
  105. X    b) cause the whole of any work that you distribute or publish, that
  106. X    in whole or in part contains the Program or any part thereof, either
  107. X    with or without modifications, to be licensed at no charge to all
  108. X    third parties under the terms of this General Public License (except
  109. X    that you may choose to grant warranty protection to some or all
  110. X    third parties, at your option).
  111. X
  112. X    c) If the modified program normally reads commands interactively when
  113. X    run, you must cause it, when started running for such interactive use
  114. X    in the simplest and most usual way, to print or display an
  115. X    announcement including an appropriate copyright notice and a notice
  116. X    that there is no warranty (or else, saying that you provide a
  117. X    warranty) and that users may redistribute the program under these
  118. X    conditions, and telling the user how to view a copy of this General
  119. X    Public License.
  120. X
  121. X    d) You may charge a fee for the physical act of transferring a
  122. X    copy, and you may at your option offer warranty protection in
  123. X    exchange for a fee.
  124. X
  125. XMere aggregation of another independent work with the Program (or its
  126. Xderivative) on a volume of a storage or distribution medium does not bring
  127. Xthe other work under the scope of these terms.
  128. X
  129. X  3. You may copy and distribute the Program (or a portion or derivative of
  130. Xit, under Paragraph 2) in object code or executable form under the terms of
  131. XParagraphs 1 and 2 above provided that you also do one of the following:
  132. X
  133. X    a) accompany it with the complete corresponding machine-readable
  134. X    source code, which must be distributed under the terms of
  135. X    Paragraphs 1 and 2 above; or,
  136. X
  137. X    b) accompany it with a written offer, valid for at least three
  138. X    years, to give any third party free (except for a nominal charge
  139. X    for the cost of distribution) a complete machine-readable copy of the
  140. X    corresponding source code, to be distributed under the terms of
  141. X    Paragraphs 1 and 2 above; or,
  142. X
  143. X    c) accompany it with the information you received as to where the
  144. X    corresponding source code may be obtained.  (This alternative is
  145. X    allowed only for noncommercial distribution and only if you
  146. X    received the program in object code or executable form alone.)
  147. X
  148. XSource code for a work means the preferred form of the work for making
  149. Xmodifications to it.  For an executable file, complete source code means
  150. Xall the source code for all modules it contains; but, as a special
  151. Xexception, it need not include source code for modules which are standard
  152. Xlibraries that accompany the operating system on which the executable
  153. Xfile runs, or for standard header files or definitions files that
  154. Xaccompany that operating system.
  155. X
  156. X  4. You may not copy, modify, sublicense, distribute or transfer the
  157. XProgram except as expressly provided under this General Public License.
  158. XAny attempt otherwise to copy, modify, sublicense, distribute or transfer
  159. Xthe Program is void, and will automatically terminate your rights to use
  160. Xthe Program under this License.  However, parties who have received
  161. Xcopies, or rights to use copies, from you under this General Public
  162. XLicense will not have their licenses terminated so long as such parties
  163. Xremain in full compliance.
  164. X
  165. X  5. By copying, distributing or modifying the Program (or any work based
  166. Xon the Program) you indicate your acceptance of this license to do so,
  167. Xand all its terms and conditions.
  168. X
  169. X  6. Each time you redistribute the Program (or any work based on the
  170. XProgram), the recipient automatically receives a license from the original
  171. Xlicensor to copy, distribute or modify the Program subject to these
  172. Xterms and conditions.  You may not impose any further restrictions on the
  173. Xrecipients' exercise of the rights granted herein.
  174. X
  175. X  7. The Free Software Foundation may publish revised and/or new versions
  176. Xof the General Public License from time to time.  Such new versions will
  177. Xbe similar in spirit to the present version, but may differ in detail to
  178. Xaddress new problems or concerns.
  179. X
  180. XEach version is given a distinguishing version number.  If the Program
  181. Xspecifies a version number of the license which applies to it and "any
  182. Xlater version", you have the option of following the terms and conditions
  183. Xeither of that version or of any later version published by the Free
  184. XSoftware Foundation.  If the Program does not specify a version number of
  185. Xthe license, you may choose any version ever published by the Free Software
  186. XFoundation.
  187. X
  188. X  8. If you wish to incorporate parts of the Program into other free
  189. Xprograms whose distribution conditions are different, write to the author
  190. Xto ask for permission.  For software which is copyrighted by the Free
  191. XSoftware Foundation, write to the Free Software Foundation; we sometimes
  192. Xmake exceptions for this.  Our decision will be guided by the two goals
  193. Xof preserving the free status of all derivatives of our free software and
  194. Xof promoting the sharing and reuse of software generally.
  195. X
  196. X                NO WARRANTY
  197. X
  198. X  9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
  199. XFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
  200. XOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
  201. XPROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
  202. XOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  203. XMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
  204. XTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
  205. XPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
  206. XREPAIR OR CORRECTION.
  207. X
  208. X  10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
  209. XWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
  210. XREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
  211. XINCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
  212. XOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
  213. XTO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
  214. XYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
  215. XPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
  216. XPOSSIBILITY OF SUCH DAMAGES.
  217. X
  218. X             END OF TERMS AND CONDITIONS
  219. X
  220. X    Appendix: How to Apply These Terms to Your New Programs
  221. X
  222. X  If you develop a new program, and you want it to be of the greatest
  223. Xpossible use to humanity, the best way to achieve this is to make it
  224. Xfree software which everyone can redistribute and change under these
  225. Xterms.
  226. X
  227. X  To do so, attach the following notices to the program.  It is safest to
  228. Xattach them to the start of each source file to most effectively convey
  229. Xthe exclusion of warranty; and each file should have at least the
  230. X"copyright" line and a pointer to where the full notice is found.
  231. X
  232. X    <one line to give the program's name and a brief idea of what it does.>
  233. X    Copyright (C) 19yy  <name of author>
  234. X
  235. X    This program is free software; you can redistribute it and/or modify
  236. X    it under the terms of the GNU General Public License as published by
  237. X    the Free Software Foundation; either version 1, or (at your option)
  238. X    any later version.
  239. X
  240. X    This program is distributed in the hope that it will be useful,
  241. X    but WITHOUT ANY WARRANTY; without even the implied warranty of
  242. X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  243. X    GNU General Public License for more details.
  244. X
  245. X    You should have received a copy of the GNU General Public License
  246. X    along with this program; if not, write to the Free Software
  247. X    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  248. X
  249. XAlso add information on how to contact you by electronic and paper mail.
  250. X
  251. XIf the program is interactive, make it output a short notice like this
  252. Xwhen it starts in an interactive mode:
  253. X
  254. X    Gnomovision version 69, Copyright (C) 19xx name of author
  255. X    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  256. X    This is free software, and you are welcome to redistribute it
  257. X    under certain conditions; type `show c' for details.
  258. X
  259. XThe hypothetical commands `show w' and `show c' should show the
  260. Xappropriate parts of the General Public License.  Of course, the
  261. Xcommands you use may be called something other than `show w' and `show
  262. Xc'; they could even be mouse-clicks or menu items--whatever suits your
  263. Xprogram.
  264. X
  265. XYou should also get your employer (if you work as a programmer) or your
  266. Xschool, if any, to sign a "copyright disclaimer" for the program, if
  267. Xnecessary.  Here a sample; alter the names:
  268. X
  269. X  Yoyodyne, Inc., hereby disclaims all copyright interest in the
  270. X  program `Gnomovision' (a program to direct compilers to make passes
  271. X  at assemblers) written by James Hacker.
  272. X
  273. X  <signature of Ty Coon>, 1 April 1989
  274. X  Ty Coon, President of Vice
  275. X
  276. XThat's all there is to it!
  277. END_OF_FILE
  278. if test 12488 -ne `wc -c <'COPYING'`; then
  279.     echo shar: \"'COPYING'\" unpacked with wrong size!
  280. fi
  281. # end of 'COPYING'
  282. fi
  283. if test -f 'drivers.c' -a "${1}" != "-c" ; then 
  284.   echo shar: Will not clobber existing file \"'drivers.c'\"
  285. else
  286. echo shar: Extracting \"'drivers.c'\" \(14158 characters\)
  287. sed "s/^X//" >'drivers.c' <<'END_OF_FILE'
  288. X#include<stdio.h>
  289. X
  290. X#include <ctype.h>
  291. X#include "chesstype.h"
  292. X#include "notation.h"
  293. X#include "drivers.h"
  294. X
  295. X/* postscript characters translation table
  296. X   one entry per piece
  297. X   each entry has four fields:
  298. X   - white piece on white case
  299. X   - white piece on black case
  300. X   - black piece on ...
  301. X   ..
  302. X */
  303. X#define PSINDEX(a,b) ((((a)==WHITE)?0:2)+(((b)%2)?0:1))
  304. X
  305. Xstatic char * postscript_table[][4] = {
  306. X  { " ", "x",     " ", "x"     }, /* void */
  307. X  { "k", "\\373", "K", "\\360" }, /* king */
  308. X  { "q", "\\317", "Q", "\\316" }, /* queen */
  309. X  { "r", "\\250", "R", "\\345" }, /* rook */
  310. X  { "b", "\\272", "B", "\\365" }, /* bishop */
  311. X  { "n", "\\265", "N", "\\366" }, /* knight */
  312. X  { "p", "\\271", "P", "\\270" }  /* pawn */
  313. X};
  314. X
  315. X/* TeX table for using the chess figure in board design */
  316. Xstatic char * metafont_table[][4] = {
  317. X  /*   W/W      W/B      B/W      B/B */
  318. X  { "\\WWW", "\\DDD", "\\WWW", "\\DDD" }, /* void */
  319. X  { "\\WKW", "\\WKB", "\\BKW", "\\BKB" }, /* king */
  320. X  { "\\WQW", "\\WQB", "\\BQW", "\\BQB" }, /* queen */
  321. X  { "\\WRW", "\\WRB", "\\BRW", "\\BRB" }, /* rook */
  322. X  { "\\WBW", "\\WBB", "\\BBW", "\\BBB" }, /* bishop */
  323. X  { "\\WNW", "\\WNB", "\\BNW", "\\BNB" }, /* knight */
  324. X  { "\\WPW", "\\WPB", "\\BPW", "\\BPB" }  /* pawn */
  325. X};
  326. X
  327. X/* TeX table for using the chess figures in move description */
  328. Xstatic char * latex_table[] = {
  329. X  "\\FigVoid", "\\FigK", "\\FigQ", "\\FigR", "\\FigB", "\\FigN", "\\FigP"
  330. X};
  331. X
  332. X/* various tex symbols */
  333. Xstatic char FigDash[] = "\\FigDash";
  334. Xstatic char FigCapt[] = "\\FigCapt";
  335. Xstatic char FigDots[] = "\\FigDots";
  336. Xstatic char FigDot[] = "\\FigDot";
  337. X
  338. X#define G_ROQUE  "O-O-O" 
  339. X#define P_ROQUE  "O-O" 
  340. X
  341. Xstatic FILE * ftmp ;
  342. X
  343. X
  344. X/* ---------------- output functions ---------------- */
  345. X
  346. X/* convert a roque in term of king's move */
  347. Xstatic int roque_to_move(m)
  348. X     depl * m;
  349. X{
  350. X
  351. X  m->piece = KING;
  352. X  m->fromcol   = 5;
  353. X  if (m->type == GRANDROQUE)  
  354. X    m->tocol = 3;
  355. X  else
  356. X    m->tocol = 7;
  357. X
  358. X  if (m->whiteturn)
  359. X    m->fromlig = m->tolig = 1;
  360. X  else
  361. X    m->fromlig = m->tolig = 8;
  362. X
  363. X  return(TRUE);
  364. X}
  365. X
  366. X/* (kind of) buffering of output */
  367. Xstatic void init_buffer(d,side)
  368. X     format * d;
  369. X     int side ;
  370. X{
  371. X  switch (d->type) {
  372. X  case D_ASCII:
  373. X    if (side != BLACK) (void) sprintf(d->white_buffer,"...");
  374. X    if (side != WHITE) (void) sprintf(d->black_buffer,"   ");
  375. X    break;
  376. X  case D_TEX:
  377. X    if (side != BLACK) (void) sprintf(d->white_buffer,"%s",FigDots);
  378. X    if (side != WHITE) (void) sprintf(d->black_buffer,"~");
  379. X    break;
  380. X  default:
  381. X    if (side != BLACK) d->white_buffer[0] = '\0' ;
  382. X    if (side != WHITE) d->black_buffer[0] = '\0' ;
  383. X    break;
  384. X  }
  385. X}
  386. X
  387. X/* this procedure is responsible for PRINTING the move */
  388. Xstatic void flush_buffer(d)
  389. X     format * d;
  390. X{
  391. X  
  392. X  /* if we have been inteerupted (by a comment, a board display etc...
  393. X     if the move is black
  394. X     we display <movenumber> ... <blackmove>
  395. X     */
  396. X  if ((d->interrupt == TRUE) && (d->iswhiteturn == FALSE)) {
  397. X    switch (d->type) {
  398. X    case D_TEX:
  399. X      (void) fprintf(d->outfile,
  400. X             "\\noindent\\movenumber{\\bf %s\\FigDot}\\whitemove{%s}\\blackmove{%s}\n", 
  401. X             d->move_buffer,FigDots,d->black_buffer);
  402. X      break;
  403. X    case D_GNU:
  404. X      /* no special case for GNU */
  405. X      (void) fprintf(d->outfile,"\t%s\n",d->black_buffer);
  406. X      break;    
  407. X    default:
  408. X      (void) fprintf(d->outfile,"%3s.%9s%9s\n", 
  409. X             d->move_buffer,"...",d->black_buffer);
  410. X      break;
  411. X    }
  412. X    d->interrupt = FALSE ;
  413. X  } else {
  414. X  /* else (no interrupt)
  415. X     we display either white or black move 
  416. X     */
  417. X    switch (d->type) {
  418. X    case D_TEX:
  419. X      if (d->iswhiteturn)
  420. X    (void) fprintf(d->outfile,
  421. X               "\\noindent\\movenumber{\\bf %s\\FigDot}\\whitemove{%s}", d->move_buffer,d->white_buffer);
  422. X      else
  423. X    (void) fprintf(d->outfile,
  424. X               "\\blackmove{%s}\n",d->black_buffer);
  425. X      break;
  426. X    case D_GNU:
  427. X      if (d->iswhiteturn)
  428. X    (void) fprintf(d->outfile,"\t%s",d-> white_buffer);
  429. X      else
  430. X    (void) fprintf(d->outfile,"\t%s\n",d->black_buffer);
  431. X      break;    
  432. X    default:
  433. X      if (d->iswhiteturn)
  434. X    (void) fprintf(d->outfile,"%3s.%9s", d->move_buffer,d->white_buffer);
  435. X      else
  436. X    (void) fprintf(d->outfile,"%9s\n", d->black_buffer);
  437. X      break;
  438. X    }
  439. X  } /* end printing */
  440. X
  441. X  /* reset buffer */
  442. X  if (! d->iswhiteturn)
  443. X    init_buffer(d,VOID);
  444. X  d->interrupt = FALSE;
  445. X}
  446. X
  447. X/* a generic parametrised driver for move output
  448. X   */
  449. Xstatic void output_move_generic(dr,d)
  450. X     format * dr;
  451. X     depl *d;
  452. X{
  453. X  char ligne[128] ;
  454. X  char themove[128] ;
  455. X  char thepiece[16]  ;
  456. X  char debcol[16];
  457. X  char frommove[16]  ;
  458. X  char tomove[16] ;
  459. X  char lie[16] ;
  460. X  char prom[16];
  461. X
  462. X  int ambigue = FALSE ;
  463. X
  464. X  ligne[0] = themove[0] = thepiece[0] = debcol[0]  = '\0';
  465. X  frommove[0] = tomove[0] = lie[0] = prom[0] = '\0' ;
  466. X
  467. X
  468. X  (void) sprintf (dr->move_buffer,"%d",d->move);
  469. X
  470. X  if ((d->type == PETITROQUE) && !dr->roque_alg)
  471. X    (void) sprintf (themove,"%s",P_ROQUE);
  472. X  if ((d->type == GRANDROQUE) && !dr->roque_alg)
  473. X    (void) sprintf (themove,"%s",G_ROQUE);
  474. X  if (dr->roque_alg && 
  475. X      ((d->type == GRANDROQUE) || (d->type == PETITROQUE)))
  476. X    (void) roque_to_move(d);
  477. X
  478. X  if (dr-> roque_alg || 
  479. X      ((d->type != GRANDROQUE) && (d->type != PETITROQUE))) {
  480. X
  481. X    /* we check here for ambiguous move */
  482. X    if ((d->type != GRANDROQUE) && (d->type != PETITROQUE)) {
  483. X      ambigue = ambiguity (d->piece, d->tolig,d->tocol);
  484. X      /* if ( (ambigue ) && (d->piece != PAWN ))
  485. X       * (void) fprintf (stderr,"ambiguity at move %d",tos->move);
  486. X       */
  487. X    }
  488. X    themove[0] = '\0' ;
  489. X    if ((dr->output_move_format == SHORTENED) 
  490. X    && (d->type == PRISE) && (d->piece == PAWN))
  491. X      (void) sprintf (debcol, "%c",coltoletter(d->fromcol));
  492. X
  493. X    if (dr->print_piece)
  494. X      if (d->piece != PAWN || dr->print_pawn) {
  495. X    if (dr->type == D_TEX )
  496. X      (void) sprintf(thepiece,"%s ",latex_table[d->piece]);
  497. X    else
  498. X      (void) sprintf(thepiece,"%c",dr->out_table[d->piece]);
  499. X      }
  500. X
  501. X    if ((dr->output_move_format == ALGEBRAIC))
  502. X      (void)sprintf(frommove,"%c%c",
  503. X            coltoletter(d->fromcol),ligtoletter(d->fromlig));
  504. X    if ( ambigue && dr->print_liaison ) {
  505. X      (void) sprintf(lie,"-");
  506. X      (void)sprintf(frommove,"%c%c",
  507. X            coltoletter(d->fromcol),ligtoletter(d->fromlig));
  508. X      debcol[0] = '\0' ;
  509. X    }
  510. X    if (d->promotion) {
  511. X      if (dr->print_piece) {
  512. X    if (dr->type == D_TEX )
  513. X      (void) sprintf(prom,"=%s ",latex_table[d->promotion]);
  514. X      else
  515. X        (void) sprintf(prom,"=%c",dr->out_table[d->promotion]);
  516. X      }
  517. X    }
  518. X          
  519. X    if (dr->print_liaison) {
  520. X      if ((d->type == PRISE) || (d->type == PROM_ET_PRISE) 
  521. X      || (d->type == EN_PASSANT) )
  522. X    (void) sprintf(lie,"%c",'x');
  523. X      else
  524. X    if ((dr->output_move_format == ALGEBRAIC))
  525. X      (void) sprintf(lie,"%c",'-');
  526. X    }
  527. X    
  528. X    (void) sprintf(tomove,"%c%c",coltoletter(d->tocol),ligtoletter(d->tolig));
  529. X
  530. X    (void) sprintf (themove,"%s%s%s%s%s%s",
  531. X            thepiece,debcol,frommove,lie, tomove,prom);
  532. X  }
  533. X
  534. X  if (d->whiteturn)
  535. X    (void) sprintf (dr->white_buffer, "%s",themove);
  536. X  else
  537. X    (void) sprintf (dr->black_buffer, "%s",themove);
  538. X
  539. X  dr->iswhiteturn = d->whiteturn; 
  540. X
  541. X  /*fprintf(dr->outfile, "=%d=%d= ",d->move,d->whiteturn);*/
  542. X  flush_buffer(dr); 
  543. X}
  544. X
  545. X/* ---------------- ascii driver ----------  */
  546. Xstatic void output_init_ascii(dr) 
  547. Xformat *dr;
  548. X{}
  549. X    
  550. Xstatic void output_board_ascii(dr,g)
  551. X     format * dr;
  552. X     game * g;
  553. X{
  554. X  register int i,j;
  555. X
  556. X  dr->interrupt = TRUE;
  557. X
  558. X  (void) fprintf(dr->outfile,"\n\n");
  559. X  for (i=8 ; i >=1 ; i--) {
  560. X    if (dr->coordinates)
  561. X      (void) fprintf(dr->outfile,"%d ",i);
  562. X    (void) fputc('|',dr->outfile);
  563. X    for (j=1 ; j<9 ; j++) {
  564. X      if (g->board[i][j] != VOID) {
  565. X    if (g->color[i][j] == WHITE) 
  566. X     (void) fputc(dr->out_table[g->board[i][j]], dr->outfile);
  567. X    else 
  568. X      (void) fputc(tolower(dr->out_table[g->board[i][j]]),dr->outfile);
  569. X      } else
  570. X    (void) fputc ( ((i+j)% 2)?' ':'/', dr->outfile);
  571. X      (void) fputc('|', dr->outfile);
  572. X    }
  573. X    (void) fputc('\n', dr->outfile);
  574. X  }
  575. X  if (dr->coordinates)
  576. X    (void) fprintf(dr->outfile,"   a b c d e f g h\n");
  577. X  (void) fprintf(dr->outfile,"\n");
  578. X}
  579. X
  580. X/* ---------------- postscript --------- */
  581. X
  582. Xstatic void output_board_ps(dr,g)
  583. X     format *dr;
  584. X     game * g;
  585. X{
  586. X  register int i,j;
  587. X  register int c;
  588. X  char chaine[MAXTOKLEN];
  589. X
  590. X  /* header file */
  591. X  (void) strcpy(chaine,LIB_DIR);
  592. X  if ((ftmp = fopen(strcat(chaine,PS_HEADER),"r")) == NULL)
  593. X    message((stderr,"Can't open ps header file.\n"));
  594. X  else {
  595. X    while ((c = getc(ftmp)) != EOF)
  596. X      (void) fputc(c,dr->outfile);
  597. X    (void) fclose(ftmp);
  598. X  }
  599. X
  600. X  (void) fprintf(dr->outfile,"( ________) 72 714 T\n");
  601. X  for (i=8 ; i >=1 ; i--) {
  602. X    (void) fprintf(dr->outfile,"(/");
  603. X    for (j=1 ; j<9 ; j++) {
  604. X    (void) fprintf(dr->outfile,"%s",
  605. X           postscript_table[g->board[i][j]][PSINDEX(g->color[i][j],(i+j))]);
  606. X    }
  607. X    (void) fprintf(dr->outfile,"\\\\) 72 %d T\n",474 + (i-1)*30);
  608. X  }
  609. X  (void) fprintf(dr->outfile,"( --------) 72 444 T\n");
  610. X
  611. X  /* footer file */
  612. X  (void) strcpy(chaine,LIB_DIR);
  613. X  if ((ftmp = fopen(strcat(chaine,PS_FOOTER),"r")) == NULL)
  614. X    message((stderr,"Can't open ps footer file.\n"));
  615. X  else {
  616. X    while ((c = getc(ftmp)) != EOF)
  617. X      (void) fputc(c,dr->outfile);
  618. X    (void) fclose(ftmp);
  619. X  }
  620. X}
  621. X
  622. X/* ---------------- nroff --------------- */
  623. Xstatic void output_init_roff(dr)
  624. X     format *dr;
  625. X{
  626. X}
  627. X
  628. Xstatic void output_board_roff(dr,g)
  629. X     format *dr;
  630. X     game * g;
  631. X{
  632. X  register int i,j;
  633. X
  634. X  dr->interrupt = TRUE;
  635. X
  636. X  (void) fprintf(dr->outfile,".br\n");
  637. X  for (i=8 ; i >=1 ; i--) {
  638. X    (void) fprintf(dr->outfile,".ce\n  ");
  639. X    for (j=1 ; j<9 ; j++) {
  640. X      if (g->board[i][j] != VOID) {
  641. X    if (g->color[i][j] == WHITE) 
  642. X     (void) fputc(dr->out_table[g->board[i][j]], dr->outfile);
  643. X    else 
  644. X      (void) fputc(tolower(dr->out_table[g->board[i][j]]),dr->outfile);
  645. X      } else
  646. X    /*(void) fputc ( ((i+j)% 2)?' ':'/', dr->outfile);*/
  647. X    (void) fprintf(dr->outfile,".");
  648. X    }
  649. X    (void) fprintf(dr->outfile,"\n.br\n");
  650. X  }
  651. X  (void) fprintf(dr->outfile,"\n");
  652. X}
  653. X
  654. X/* ---------------- tex -------------------- */
  655. Xstatic void output_init_tex(dr)
  656. X     format *dr;
  657. X{
  658. X  register int c;
  659. X  char chaine[MAXTOKLEN];
  660. X
  661. X  /* header file */
  662. X  (void) strcpy(chaine,LIB_DIR);
  663. X  if ((ftmp = fopen(strcat(chaine,TEX_HEADER),"r")) == NULL)
  664. X    message((stderr,"Can't open tex header file.\n"));
  665. X  else {
  666. X    while ((c = getc(ftmp)) != EOF)
  667. X      (void) fputc(c,dr->outfile);
  668. X    (void) fclose(ftmp);
  669. X  }
  670. X}
  671. X
  672. Xstatic void output_board_tex(dr,g)
  673. X     format *dr;
  674. X     game * g;
  675. X{
  676. X  register int i,j;
  677. X
  678. X  dr->interrupt = TRUE;
  679. X
  680. X  (void) fprintf(dr->outfile,"\n\n");
  681. X  (void)fprintf(dr->outfile,"$$\\vbox{\\bigskip\\offinterlineskip\\tabskip=0pt\n");
  682. X  (void) fprintf(dr->outfile,"\\halign{#\\vvrule &#&#&#&#&#&#&#&#&#\\vvrule \\cr\n");
  683. X  (void) fprintf(dr->outfile,"\\noalign{\\hhrule}\n");
  684. X  for (i=8 ; i >=1 ; i--) {
  685. X    (void) fprintf(dr->outfile,"&");
  686. X    for (j=1 ; j < 9 ; j++) {
  687. X    (void) fprintf(dr->outfile,"%s",
  688. X           metafont_table[g->board[i][j]][PSINDEX(g->color[i][j],(i+j))]);
  689. X      (void) fprintf(dr->outfile,"&");
  690. X    }
  691. X    (void) fprintf(dr->outfile,"\\cr \n");
  692. X  }
  693. X  (void) fprintf(dr->outfile,"\\noalign{\\hhrule}}}$$");
  694. X  (void) fprintf(dr->outfile,"");
  695. X  (void) fprintf(dr->outfile,"\n\n");
  696. X}
  697. X
  698. Xstatic void output_end_tex(dr)
  699. X     format *dr;
  700. X{ 
  701. X  (void) fprintf(dr->outfile, "~\n\n\n\\end{document}\n");
  702. X}
  703. X
  704. X/* ------------------ gnu - xchess ---------- */
  705. X
  706. Xstatic void output_init_gnu(dr)
  707. X     format *dr;
  708. X{
  709. X  (void) fprintf(dr->outfile, "X Chess -- Mon Dec 10 11:47:18 MET 1990\n");
  710. X  (void) fprintf(dr->outfile,"\tGame played on dumbkopft.irisa.fr:0.0\n");
  711. X  (void) fprintf(dr->outfile,"\talgebraic\n");
  712. X}
  713. X
  714. X/* ---------------- driver handler ---------- */
  715. X/* dummy driver */
  716. Xstatic void null_driver() {}
  717. X
  718. X/* the drivers */
  719. Xvoid output_init(dr)
  720. X     format *dr ;
  721. X{
  722. X  dr->out_init(dr);
  723. X}
  724. X
  725. Xvoid output_move(dr,d)
  726. X     format *dr ;
  727. X     depl *d;
  728. X{
  729. X  dr->out_move(dr,d);
  730. X}
  731. X
  732. Xvoid output_board(dr,g)
  733. X     format *dr ;
  734. X     game *g ;
  735. X{
  736. X  dr->out_board(dr,g);
  737. X}
  738. X
  739. Xvoid output_end(dr)
  740. X     format *dr ;
  741. X{
  742. X  dr->out_end(dr);
  743. X}
  744. X
  745. X
  746. Xformat * new_driver()
  747. X{
  748. X  format * tmp;
  749. X  int i; 
  750. X
  751. X  tmp = (format *) malloc (sizeof(format));
  752. X  ALLOCP(tmp);
  753. X  /*for (i=0; i < ((sizeof (format))/ sizeof (int)) ; i++)
  754. X    ((int *) tmp)[i] = 0;*/
  755. X  return(tmp);
  756. X}
  757. X
  758. Xvoid init_driver(dr,driver)
  759. X     format * dr;
  760. X     int driver;
  761. X{
  762. X  dr->type = driver ;
  763. X
  764. X  switch (dr->type) {
  765. X  case D_ASCII:
  766. X    dr->print_move = TRUE;
  767. X    dr->print_piece = TRUE;
  768. X    dr->print_pawn = FALSE;
  769. X    dr->roque_alg = FALSE;
  770. X    dr->print_liaison = TRUE;
  771. X    dr->out_init = output_init_ascii;
  772. X    dr->out_move = output_move_generic;
  773. X    dr->out_board = output_board_ascii;
  774. X    dr->out_end = null_driver;
  775. X    break;
  776. X  case D_POST:
  777. X    dr->out_init = null_driver;
  778. X    dr->out_move = null_driver;
  779. X    dr->out_board = output_board_ps;
  780. X    dr->out_end = null_driver;
  781. X    break;
  782. X  case D_TEX:
  783. X    dr->print_move = TRUE;
  784. X    dr->print_piece = TRUE;
  785. X    dr->print_pawn = FALSE;
  786. X    dr->roque_alg = FALSE;
  787. X    dr->print_liaison = TRUE;
  788. X    dr->out_init = output_init_tex;
  789. X    dr->out_move = output_move_generic;
  790. X    dr->out_board = output_board_tex;
  791. X    dr->out_end = output_end_tex;
  792. X    break;
  793. X  case D_ROFF:
  794. X    dr->print_move = TRUE;
  795. X    dr->print_piece = TRUE;
  796. X    dr->print_pawn = FALSE;
  797. X    dr->roque_alg = FALSE;
  798. X    dr->print_liaison = TRUE;
  799. X    dr->out_init = output_init_roff;
  800. X    dr->out_move = output_move_generic;
  801. X    dr->out_board = output_board_roff;
  802. X    dr->out_end = null_driver;
  803. X    break;
  804. X  case D_XCHESS:
  805. X    dr->print_move = TRUE;
  806. X    dr->print_piece = FALSE;
  807. X    dr->print_pawn = FALSE;
  808. X    dr->roque_alg = TRUE;
  809. X    dr->print_liaison = FALSE;
  810. X    dr->out_init = output_init_gnu;
  811. X    dr->out_move = output_move_generic;
  812. X    dr->out_board = null_driver;
  813. X    dr->out_end = null_driver;
  814. X    break;
  815. X  case D_GNU:
  816. X    dr->print_move = FALSE;
  817. X    dr->print_piece = FALSE;
  818. X    dr->print_pawn = FALSE;
  819. X    dr->roque_alg = TRUE;
  820. X    dr->print_liaison = FALSE;
  821. X    dr->out_init = null_driver;
  822. X    dr->out_move = output_move_generic;
  823. X    dr->out_board = null_driver;
  824. X    dr->out_end = null_driver;
  825. X    break;
  826. X  default:
  827. X    error((stderr,"unknown driver"));
  828. X    break;
  829. X  }
  830. X  if (dr->only_board)
  831. X    dr->out_move = null_driver ;
  832. X
  833. X  dr->variation_level = 0;
  834. X  dr->iswhiteturn = FALSE ;
  835. X  dr->interrupt = FALSE;
  836. X  init_buffer(dr, VOID);
  837. X}
  838. END_OF_FILE
  839. if test 14158 -ne `wc -c <'drivers.c'`; then
  840.     echo shar: \"'drivers.c'\" unpacked with wrong size!
  841. fi
  842. # end of 'drivers.c'
  843. fi
  844. if test -f 'notation.doc' -a "${1}" != "-c" ; then 
  845.   echo shar: Will not clobber existing file \"'notation.doc'\"
  846. else
  847. echo shar: Extracting \"'notation.doc'\" \(12209 characters\)
  848. sed "s/^X//" >'notation.doc' <<'END_OF_FILE'
  849. X
  850. X
  851. X
  852. Xnotation(n)       MISC. REFERENCE MANUAL PAGES        notation(n)
  853. X
  854. X
  855. X
  856. XNAME
  857. X     notation - transform chess notation
  858. X
  859. X
  860. XSYNOPSYS
  861. X     notation [input file] [-o output file] [options...]
  862. X
  863. X
  864. XDESCRIPTION
  865. X     This program reads chess games,  either  full  algebraic  or
  866. X     shortened (ie Nf1-g3 or Ng3) and is able to ouptut the board
  867. X     after any move, in either ascii , postscript,  nroff,  latex
  868. X     or  xchess  save format. This program is also multi-lingual:
  869. X     it handles english, french,  spanish,  german,  italian  and
  870. X     dutch symbols.
  871. X
  872. X
  873. XOPTIONS
  874. X     Command line options:
  875. X
  876. X        -a
  877. X             algebraic move notation output
  878. X
  879. X        -s
  880. X             shortened move notation output
  881. X
  882. X     -f <language>
  883. X             specifies  the  chess  symbol  input  language.  The
  884. X             language   can  be  any of french, english, italian,
  885. X             spanish, german, dutch.
  886. X
  887. X        -t <language>
  888. X             specifies the chess  symbol  output  language.  Same
  889. X             options as input language.
  890. X
  891. X     <inputfile>
  892. X             specifies the  input  file.  If  none,  keyboard  is
  893. X             assumed.
  894. X
  895. X        -o <outputfile>
  896. X             specifies  the  output  file.  If  none,  screen  is
  897. X             assumed.
  898. X
  899. X     -c <number>[,<number]
  900. X             specifies the number  of  the  moves  at  which   to
  901. X             display  the  board.  If none, board is displayed at
  902. X             end of file. Several numbers may be specified, as  a
  903. X             comma-separated list.
  904. X
  905. X     -e <number>
  906. X             display the board at the move number and then stops
  907. X
  908. X
  909. X
  910. X
  911. XSun Release 4.1   Last change: 10 December 1990                 1
  912. X
  913. X
  914. X
  915. X
  916. X
  917. X
  918. Xnotation(n)       MISC. REFERENCE MANUAL PAGES        notation(n)
  919. X
  920. X
  921. X
  922. X        -b
  923. X             display only the board, not the moves
  924. X
  925. X        -d <drivername>
  926. X             specifies the output driver. It can be  any  of  the
  927. X             following:  ascii,  postscript,  tex,  roff,  xchess
  928. X             (xchess or xboard save  format),  gnu  (gnuan  input
  929. X             format).
  930. X
  931. X        -h
  932. X             displays help screen
  933. X
  934. X
  935. XINPUT LANGUAGE
  936. X           The input language has four  types  of  input:  moves,
  937. X     move numbers, comments and keywords. All these are separated
  938. X     by blanks, TAB or RC.  Commas are not accepted.
  939. X
  940. X
  941. X     move format:
  942. X             The moves are accepted  in  algebraic  or  shortened
  943. X             algebraic  notation.  That  means that the following
  944. X             are equivalent and accepted  Nf1-g3  N-f1xg3,  Nxg3,
  945. X             Ng3.  The  ugly  english notation P-K4 is not under-
  946. X             stood, neither by the program nor me.
  947. X
  948. X             Nota: provided you  remove  the  three  first  line,
  949. X             xchess  save  format is accepted.  Also you can have
  950. X             trailing comments to  move,  provided  there  is  no
  951. X             blanks. So Kg4!!, Ra5++ are correct, but not Kg4 !!,
  952. X             Ra5 ++ because of the  separating  blank.  A  future
  953. X             version might handle these move comments, as well as
  954. X             + ++, mate, white resigns etc... Castling is  recog-
  955. X             nized  with the following 0-0 O-O o-o 0-0-0 O-O-O o-
  956. X             o-o. "En passant" and promotion  are  now  correctly
  957. X             handled.  For  "en  passant", you just indicate them
  958. X             move and it is correctly parsed ex:  "d5-d7  e5xd6".
  959. X             Promotion is indicated with the "=" sign followed by
  960. X             the new piece name. So you just write  "a7-a8=Q"  or
  961. X             "d8=K".
  962. X
  963. X             For  example,  see  the  files   algebraic.txt   and
  964. X             shortened.txt
  965. X
  966. X
  967. X     move numbers:
  968. X             move numbers are in the form 23.  or  36.  The  full
  969. X             point  is optional. Move numbers are checked against
  970. X             internal move counter.
  971. X
  972. X
  973. X     comments:
  974. X
  975. X
  976. X
  977. XSun Release 4.1   Last change: 10 December 1990                 2
  978. X
  979. X
  980. X
  981. X
  982. X
  983. X
  984. Xnotation(n)       MISC. REFERENCE MANUAL PAGES        notation(n)
  985. X
  986. X
  987. X
  988. X             anything else, except keywords, must be enclosed  in
  989. X             brackets  or  parenthesis  [Here  Karpov made a very
  990. X             bright move ...] (this is also a comment).  Comments
  991. X             are  skipped out.  A future version might incorporte
  992. X             them in the output.
  993. X
  994. X
  995. X     keywords:
  996. X             you can insert keywords in the input  text  to  pre-
  997. X             cisely  define  what you want: displaying the board,
  998. X             configuring it... Keywords are detailled in the next
  999. X             section.
  1000. X
  1001. X
  1002. XKEYWORDS
  1003. X     All keywords are prefixed with @
  1004. X
  1005. X     @startplay
  1006. X             begins the play. Obligatory after a @configxxx  key-
  1007. X             word.
  1008. X
  1009. X     @clearboard
  1010. X             clears the board. Used prior to any @configxxx.
  1011. X
  1012. X     @showboard
  1013. X             displays the board. Can be used anywhere
  1014. X
  1015. X     @whitesmove
  1016. X             tells the program that is the white's turn of  play.
  1017. X             Useful after a @configxxx and @startplay
  1018. X
  1019. X     @blacksmove
  1020. X             tells the program that it is black's turn
  1021. X
  1022. X     @configwhite
  1023. X             initializes configuration of white side. Pieces  are
  1024. X             then  expected, in form of (optional for Pawn) name,
  1025. X             the position. Example @configwhite Ke3 Rg8 e4.
  1026. X
  1027. X     @configblack
  1028. X             initializes configuration of black side. Pieces  are
  1029. X             then  expected, in form of (optional for Pawn) name,
  1030. X             the position. Example: @configblack Ka8 Nf6 e6.
  1031. X
  1032. X             Note that black pieces are given in uppercase!
  1033. X
  1034. X     @default
  1035. X             resets the board to the default start configuration.
  1036. X
  1037. X     @special
  1038. X             all following text up to the next cariage return  is
  1039. X             not  processed,  but  instead  directly  print. This
  1040. X
  1041. X
  1042. X
  1043. XSun Release 4.1   Last change: 10 December 1990                 3
  1044. X
  1045. X
  1046. X
  1047. X
  1048. X
  1049. X
  1050. Xnotation(n)       MISC. REFERENCE MANUAL PAGES        notation(n)
  1051. X
  1052. X
  1053. X
  1054. X             allows to insert comments in  ascii  files,  or  tex
  1055. X             commands when tex output is selected.
  1056. X
  1057. X     @null   Null keyword. Does nothing. Used for convenience  in
  1058. X             programming.
  1059. X
  1060. X
  1061. X             See the file keywords.txt for an example of keywords
  1062. X             use.
  1063. X
  1064. X
  1065. XNATIONAL LANGUAGES
  1066. X     Here are the symbols used in the  differents  languages.  ()
  1067. X     mean optional in the input.
  1068. X
  1069. X
  1070. X     english-name   King Queen     Rook Bishop    Knight    Pawn
  1071. X     english        K    Q    R    B    N    (P)
  1072. X     french         R    D    T    F    C    (P)
  1073. X     italian        R    D    T    A    C    (P)
  1074. X     spanish        R    D    T    A    C    (P)
  1075. X     german         K    D    T    L    S    (B)
  1076. X     dutch          K    D    T    L    P    (O)
  1077. X
  1078. X
  1079. X
  1080. XDRIVERS
  1081. X     ascii   this is the default  driver,  it  outputs  move  and
  1082. X             boards.
  1083. X
  1084. X     postscript
  1085. X             it  generates  a  file  using  the  font  file  Cheq
  1086. X             licensed  for  free  by  Adobe.  It  is only able to
  1087. X             display one board per run. Move are  not  displayed.
  1088. X             You  need  the  font  "Cheq",  freely distributed by
  1089. X             Adobe.  Send a  mail  to  "ps-file-server@adobe.com"
  1090. X             with  the body "send Programs chessfont.ps". For use
  1091. X             with "notation", rename the file "Cheq".
  1092. X
  1093. X     tex     this is a latex driver. It uses the TeX/LaTeX  chess
  1094. X             macros designed by Piet Tutalaers "rcpt@urc.tue.nl".
  1095. X             The   complete   distribution   is   available    on
  1096. X             sol.cs.ruu.nl      (131.211.80.5)      with     path
  1097. X             TEX/chess.tar.Z chesscls, provided in  the  library.
  1098. X             Refer to your local latex guru to install it.
  1099. X
  1100. X     roff    this is a driver for nroff output. It is crude,  but
  1101. X             it works. Moves and boards are displayed.
  1102. X
  1103. X     xchess  This driver generates compatible xchess/xboard  save
  1104. X             files,  thus  allowing  you  to  replay  a game with
  1105. X             xchess.
  1106. X
  1107. X
  1108. X
  1109. XSun Release 4.1   Last change: 10 December 1990                 4
  1110. X
  1111. X
  1112. X
  1113. X
  1114. X
  1115. X
  1116. Xnotation(n)       MISC. REFERENCE MANUAL PAGES        notation(n)
  1117. X
  1118. X
  1119. X
  1120. X     gnu     This driver completely "bare" file,  with  only  the
  1121. X             algebraic  move.  It  is  suitable for any low-level
  1122. X             analyser, such as gnuan.
  1123. X
  1124. X
  1125. XEXAMPLES
  1126. X          Try the following commands:
  1127. X
  1128. X     notation algebraic.txt
  1129. X             this will read the  Karpov-Kasparov  game  13  (Lyon
  1130. X             1990)  in  algebraic form, display move in algebraic
  1131. X             and display board at end of game.
  1132. X
  1133. X     notation algebraic.txt -a
  1134. X             this will do the same thing, as -a stands for  alge-
  1135. X             braic output.
  1136. X
  1137. X     notation algebraic.txt -s
  1138. X             the game will now be output in shortened algebraic
  1139. X
  1140. X     notation shortened.txt
  1141. X             there is no problem to read shortened algebraic.
  1142. X
  1143. X     notation shortened -s -o result
  1144. X             the moves and board will be directed to file result
  1145. X
  1146. X     notation shortened.txt -s -t french
  1147. X             output will use french notation
  1148. X
  1149. X     notation a_dutch_file -f dutch -t spanish
  1150. X             game will be translated form dutch to spanish
  1151. X
  1152. X     notation shortened -c 2
  1153. X             board after move 2 will  be  displayed,  along  with
  1154. X             moves and end-of-game board
  1155. X
  1156. X     notation shortened -e 2
  1157. X             board after move 2 will  be  displayed,  along  with
  1158. X             moves. The program will then stops
  1159. X
  1160. X     notation shortened -c 2,5,20
  1161. X             board after moves 2, 5 and  20  will  be  displayed,
  1162. X             along with moves and end-of-game board
  1163. X
  1164. X     notation shortened -c 2,5,20 -b
  1165. X             board after moves 2, 5 and  20  will  be  displayed,
  1166. X             with end-of-game board, but no moves.
  1167. X
  1168. X     notation shortened -c 2,5,20 -d tex
  1169. X             the output will be formatted to use with latex.  You
  1170. X             can directly latex the output file.
  1171. X
  1172. X
  1173. X
  1174. X
  1175. XSun Release 4.1   Last change: 10 December 1990                 5
  1176. X
  1177. X
  1178. X
  1179. X
  1180. X
  1181. X
  1182. Xnotation(n)       MISC. REFERENCE MANUAL PAGES        notation(n)
  1183. X
  1184. X
  1185. X
  1186. X     notation shortened -c 2,5,20 -d gnu
  1187. X             you can now replay  the  game  by  using  xchess  -r
  1188. X             out.gnu.
  1189. X
  1190. X     notation shortened -e 5 -d postscript
  1191. X             Now issue cat lib/Cheq out.ps | lpr to display on  a
  1192. X             Laser  Printer  the  board  at  move 5. You can also
  1193. X             issue sh print-ps out-ps.  The postcript driver does
  1194. X             not support the -c option.
  1195. X
  1196. X
  1197. XFILES
  1198. X     algebraic.txt shortened.txt keywords.txt
  1199. X             these are examples of input files
  1200. X
  1201. X
  1202. X     ./lib/HELPFILE
  1203. X             this is the on-line helpfile
  1204. X
  1205. X
  1206. X     ./lib/(Cheq Header.ps Footer.ps)
  1207. X             these files are needed by the postscript driver
  1208. X
  1209. X
  1210. X     ./lib/Header.tex
  1211. X             these file is needed by the (la)tex driver
  1212. X
  1213. X
  1214. X     ./lib/chesscls.mf
  1215. X             this file is used the generate the tex font
  1216. X
  1217. X
  1218. XSEE ALSO
  1219. X     xchess(1), chess(6), gnuchess(1), latex(1), nroff(1), lpr(1)
  1220. X
  1221. X
  1222. XDIAGNOSTICS
  1223. X     Errors messages are hoped to be self-explanative.
  1224. X
  1225. X
  1226. XCOMMENTS
  1227. X     The program is quite large, due to the large use  of  tables
  1228. X     and  variables to control its features. The advantage is you
  1229. X     only need the modify  these  tables  to  customize  it:  for
  1230. X     instance  adding  a new language or tuning the output format
  1231. X     to your own needs.
  1232. X
  1233. X
  1234. XBUGS
  1235. X     Too many. Report them to Henry.Thomas@irisa.fr.
  1236. X
  1237. X     The postscript driver *might* fais if you try to display the
  1238. X
  1239. X
  1240. X
  1241. XSun Release 4.1   Last change: 10 December 1990                 6
  1242. X
  1243. X
  1244. X
  1245. X
  1246. X
  1247. X
  1248. Xnotation(n)       MISC. REFERENCE MANUAL PAGES        notation(n)
  1249. X
  1250. X
  1251. X
  1252. X     board  two times. Anyway, it is not designed to do this. Use
  1253. X     -e option to specify the move at which you want  to  display
  1254. X     board.
  1255. X
  1256. X
  1257. XAUTHOR
  1258. X     Henry    Thomas    IRISA-Rennes,    FRANCE.    E-mail     to
  1259. X     Henry.Thomas@irisa.fr or hthomas@irisa.fr.
  1260. X
  1261. XTHANKS
  1262. X     Thanks to Jacques Schuurman for  the  piece  description  in
  1263. X     Dutch,  Dr.  Z.   Rubinstein,  University  of  Haifa for the
  1264. X     Metafont files, Philippe Louarn for implementing these  mac-
  1265. X     ros and explaining me how to use them, Adobe Systems for the
  1266. X     font Cheq, and Jean-Luc Scharbarg for introducing me in  the
  1267. X     world of chess.
  1268. X
  1269. X
  1270. X
  1271. X
  1272. X
  1273. X
  1274. X
  1275. X
  1276. X
  1277. X
  1278. X
  1279. X
  1280. X
  1281. X
  1282. X
  1283. X
  1284. X
  1285. X
  1286. X
  1287. X
  1288. X
  1289. X
  1290. X
  1291. X
  1292. X
  1293. X
  1294. X
  1295. X
  1296. X
  1297. X
  1298. X
  1299. X
  1300. X
  1301. X
  1302. X
  1303. X
  1304. X
  1305. X
  1306. X
  1307. XSun Release 4.1   Last change: 10 December 1990                 7
  1308. X
  1309. X
  1310. X
  1311. END_OF_FILE
  1312. if test 12209 -ne `wc -c <'notation.doc'`; then
  1313.     echo shar: \"'notation.doc'\" unpacked with wrong size!
  1314. fi
  1315. # end of 'notation.doc'
  1316. fi
  1317. echo shar: End of archive 2 \(of 3\).
  1318. cp /dev/null ark2isdone
  1319. MISSING=""
  1320. for I in 1 2 3 ; do
  1321.     if test ! -f ark${I}isdone ; then
  1322.     MISSING="${MISSING} ${I}"
  1323.     fi
  1324. done
  1325. if test "${MISSING}" = "" ; then
  1326.     echo You have unpacked all 3 archives.
  1327.     rm -f ark[1-9]isdone
  1328. else
  1329.     echo You still need to unpack the following archives:
  1330.     echo "        " ${MISSING}
  1331. fi
  1332. ##  End of shell archive.
  1333. exit 0
  1334.  
  1335. --
  1336. Henry Thomas - IRISA          - E-mail: Henry.Thomas@irisa.fr 
  1337. Campus Universitaire de Beaulieu - Phone: (+33)99 36 20 00 +549  
  1338. 35042 RENNES CEDEX FRANCE      - Fax: (+33)99 38 38 32 Telex: UNIRISA 950473F
  1339. Telex Atlas X400: /X121=842950473/@atlas.fr, Fax:/X121=200099383832/@atlas.fr
  1340. --
  1341. ... Words, and the words of men, flicker and flutter and beat
  1342. Warning, sorrow and gain, salutations and mirth...        R. Kipling
  1343.  
  1344. exit 0 # Just in case...
  1345. -- 
  1346. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1347. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1348. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1349. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1350.